package com.glsc.ngateway.opmanage.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class DayPerformanceDto implements Serializable {
    private static final long serialVersionUID = 1922695501952280408L;

    //页码从1开始
    private Integer pageNo;
    //每页显示条数
    private Integer pageSize;



    @ApiModelProperty(value = "员工id")
    private Integer userId;

    @ApiModelProperty(value = "员工名称 ")
    private String userName;

    @ApiModelProperty(value = "员工oa账号")
    private String userOaAccount;

    @ApiModelProperty(value = "岗位名称")
    private String postName;

    @ApiModelProperty(value = "有效工时/min")
    private Integer manHour;

    @ApiModelProperty(value = "主动工时/min")
    private Integer accordHour;

    @ApiModelProperty(value = "被动动工时/min")
    private Integer passiveHour;

    @ApiModelProperty(value = "生效日期")
    private String effectDate;



    @ApiModelProperty(value = "开始时间 yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate startTime;

    @ApiModelProperty(value = "结束时间 yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate endTime;
}
